package com.cadre.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cadre.common.utils.oldutil.PageUtils;
import com.cadre.common.utils.oldutil.Query;
import com.cadre.system.domain.officer.B01;
import com.cadre.system.domain.officer.PostchangeEntity;
import com.cadre.system.mapper.NEWPostchangeMapper;
import com.cadre.system.mapper.PostchangeMapper;
import com.cadre.system.service.NEWPostchangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

@Service("NEWPostchangeService")
public class NEWPostchangeServiceImpl extends ServiceImpl<PostchangeMapper, PostchangeEntity> implements NEWPostchangeService {
    @Autowired
    private NEWPostchangeMapper postchangeMapper;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        //（已调整完毕） todo:修改查询方式，将sql全部迁移到xml文件中
        return new PageUtils(this.baseMapper.selectPage(new Query(params).getPage(), new LambdaQueryWrapper<>()));
    }

    @Override // com.tdqy.cadre.modular.profess.service.NEWPostchangeService
    @Transactional(rollbackFor = {Exception.class})
    public int updateByPrimaryKeySelective(PostchangeEntity postchangeEntity) {
        return this.baseMapper.updateByPrimaryKeySelective(postchangeEntity);
    }

    @Override
    public java.util.List<PostchangeEntity> selectByMaps(Map<String, Object> map) {
        return this.postchangeMapper.selectByMap(map);
    }

    @Override
    public java.util.List<B01> searchUnitByKey() {
        return this.postchangeMapper.searchUnitByKey();
    }
}
